﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using Ymatou.User.Dto.Auth;

namespace YmtAuth.Domain.Model.YmatouUser.Event
{
    public static class EventSpecifications
    {
        /// <summary>
        /// 匹配loginId 修改
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public static IMongoQuery MatchUserLoginIdUpdate(string mobile, UserSource actionSource)
        {
            return Query<LoginIdUpdateEvent>.Where(e => e.Mobile == mobile && e.UserSource == actionSource);
        }
        /// <summary>
        ///  匹配loginId 修改
        /// </summary>
        /// <param name="usereID"></param>
        /// <param name="actionSource"></param>
        /// <returns></returns>
        public static IMongoQuery MatchUserLoginIdUpdate(int usereID, UserSource actionSource)
        {
            return Query<LoginIdUpdateEvent>.Where(e => e.UserId == usereID && e.UserSource == actionSource);
        }
    }
}
